<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>工作台 - 我的笔记系统</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #e0e7ff;
            --primary-dark: #3b82f6;
            --secondary: #8b5cf6;
            --success: #10b981;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Inter", "Microsoft YaHei", sans-serif;
        }

        body {
            display: flex;
            flex-direction: column;
            height: 100vh;
            background-color: var(--bg-light);
            color: var(--text-primary);
            line-height: 1.5;
        }

        /* 顶部导航栏 */
        header {
            background: linear-gradient(90deg, var(--primary), var(--primary-dark));
            color: #fff;
            padding: 16px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: var(--shadow-md);
            z-index: 10;
        }

        header h1 {
            font-size: 1.4rem;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
        }

        header h1 i {
            font-size: 1.6rem;
        }

        /* 用户信息栏 */
        .user-bar {
            display: flex;
            align-items: center;
            gap: 16px;
            font-size: 0.95rem;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(45deg, #60a5fa, #4f46e5);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .user-info:hover .user-avatar {
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        /* 登出按钮 */
        .logout-btn {
            background-color: var(--danger);
            color: #fff;
            border: none;
            padding: 7px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: var(--transition);
            box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
            position: relative;
            overflow: hidden;
        }

        .logout-btn:hover {
            background-color: #dc2626;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
        }

        .logout-btn:active {
            transform: translateY(0);
        }

        /* 主体区域 */
        main {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 左侧导航栏 - 核心优化：使用块级布局让下拉菜单能推开下方内容 */
        nav {
            width: 230px;
            background-color: var(--bg-white);
            border-right: 1px solid var(--border-light);
            padding-top: 20px;
            box-shadow: 1px 0 2px rgba(0, 0, 0, 0.02);
            overflow-y: auto; /* 允许导航栏滚动（当内容过长时） */
        }

        /* 导航项基础样式 */
        nav a, nav .dropdown-toggle {
            display: block;
            text-decoration: none;
            color: #475569;
            padding: 13px 24px;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: var(--transition);
            border-left: 3px solid transparent;
            position: relative;
        }

        nav a i, nav .dropdown-toggle i {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
            color: #64748b;
            transition: color 0.3s ease;
        }

        nav a:hover, nav .dropdown-toggle:hover {
            background-color: var(--primary-light);
            color: var(--primary);
            border-left-color: var(--primary);
        }

        nav a:hover i, nav .dropdown-toggle:hover i {
            color: var(--primary);
        }

        nav a.active, nav .dropdown-toggle.active {
            background-color: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
            border-left-color: var(--primary);
            box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1);
        }

        nav a.active i, nav .dropdown-toggle.active i {
            color: var(--primary);
        }

        /* 下拉菜单核心优化：作为文档流一部分，展开时推开下方内容 */
        nav .dropdown {
            position: relative;
        }

        /* 下拉菜单容器 - 使用display控制显示，作为文档流一部分 */
        nav .dropdown-menu {
            display: none;
            margin: 0;
            padding: 0;
            list-style: none;
            background-color: var(--bg-white);
            border-left: 3px solid var(--primary);
            animation: dropdownFadeIn 0.2s ease;
        }

        /* 展开状态 - 显示下拉菜单并保持在文档流中 */
        nav .dropdown-menu.show {
            display: block;
        }

        /* 下拉菜单项样式 */
        nav .dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 24px 10px 50px; /* 左侧缩进更多，增强层级感 */
            font-size: 0.93rem;
            color: #475569;
            text-decoration: none;
            transition: var(--transition);
        }

        nav .dropdown-item:hover {
            background-color: var(--primary-light);
            color: var(--primary);
            padding-left: 54px; /*  hover时进一步缩进，增强交互感 */
        }

        nav .dropdown-item i {
            color: #64748b;
            transition: color 0.3s ease;
        }

        nav .dropdown-item:hover i {
            color: var(--primary);
        }

        /* 下拉箭头动画 */
        nav .dropdown-toggle .fa-angle-down {
            margin-left: auto;
            color: #94a3b8;
            transition: transform 0.2s ease;
        }

        nav .dropdown.show .dropdown-toggle .fa-angle-down {
            transform: rotate(180deg); /* 展开时箭头旋转 */
        }

        /* 内容区域 */
        section {
            flex: 1;
            padding: 30px;
            background-color: var(--bg-light);
            overflow-y: auto;
        }

        /* 欢迎区域 */
        .welcome-section {
            margin-bottom: 30px;
            padding: 20px 0;
        }

        .welcome-section h2 {
            color: var(--text-primary);
            font-size: 2.2rem;
            font-weight: 700;
            margin-bottom: 8px;
            background: linear-gradient(90deg, var(--primary), var(--primary-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .welcome-section p {
            color: var(--text-secondary);
            line-height: 1.6;
            font-size: 1.05rem;
        }

        /* 卡片容器 - 网格布局 */
        .card-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 24px;
            margin-bottom: 30px;
        }

        /* 大卡片 - 占满整行 */
        .full-width-card {
            grid-column: 1 / -1;
        }

        /* 卡片组件 */
        .card {
            background-color: var(--bg-white);
            border-radius: 16px;
            box-shadow: var(--shadow-sm);
            padding: 28px;
            transition: var(--transition);
            border: 1px solid var(--border-light);
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
        }

        .card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-4px);
        }

        .card h3 {
            margin-bottom: 16px;
            color: var(--text-primary);
            font-size: 1.3rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .card h3 i {
            color: var(--primary);
            font-size: 1.4rem;
            background-color: var(--primary-light);
            padding: 10px;
            border-radius: 50%;
        }

        .card p {
            color: var(--text-secondary);
            font-size: 0.98rem;
            line-height: 1.7;
            margin-bottom: 20px;
            flex-grow: 1;
        }

        /* 最近笔记卡片 */
        .recent-note-card .note-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid var(--border-light);
        }

        .note-date {
            color: #94a3b8;
            font-size: 0.88rem;
        }

        .note-action {
            color: var(--primary);
            font-size: 0.9rem;
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .note-action:hover {
            color: var(--primary-dark);
            transform: translateX(3px);
        }

        /* 提示卡片 */
        .tip-card {
            border-left: 4px solid var(--primary);
        }

        .tip-card h3 i {
            background-color: rgba(79, 70, 229, 0.1);
        }

        /* 后续功能卡片 */
        .future-card h3 i {
            color: var(--secondary);
            background-color: rgba(139, 92, 246, 0.1);
        }

        /* 链接样式 */
        a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
            position: relative;
            padding: 0 2px;
            transition: var(--transition);
            border-radius: 3px;
        }

        a::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            transition: width 0.3s ease;
            border-radius: 2px;
        }

        a:hover {
            color: var(--primary-dark);
            background-color: var(--primary-light);
        }

        a:hover::after {
            width: 100%;
        }

        a:active {
            color: #1e40af;
            background-color: rgba(37, 99, 235, 0.1);
        }

        a:visited {
            color: #6366f1;
        }

        a.with-icon {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        a.with-icon i {
            transition: transform 0.3s ease;
        }

        a.with-icon:hover i {
            transform: translateX(3px);
        }

        /* 操作按钮样式 */
        .action-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: auto;
            padding-top: 10px;
        }
        .action-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.95rem;
            color: #fff;
            text-decoration: none;
            box-shadow: 0 3px 8px rgba(0,0,0,0.1);
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }
        .action-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }
        .action-btn:hover::before {
            left: 100%;
        }
        .action-btn.primary {
            background: linear-gradient(90deg, var(--primary-dark), var(--primary));
        }
        .action-btn.success {
            background: linear-gradient(90deg, #059669, var(--success));
        }
        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 12px rgba(0,0,0,0.15);
        }
        .action-btn:active {
            transform: translateY(0);
        }

        /* 标签样式 */
        .tag {
            display: inline-block;
            padding: 4px 12px;
            background-color: var(--primary-light);
            color: var(--primary);
            border-radius: 16px;
            font-size: 0.85rem;
            margin-right: 8px;
            margin-bottom: 8px;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .tag:hover {
            background-color: var(--primary);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 3px 6px rgba(79, 70, 229, 0.2);
        }

        /* 响应式适配 */
        @media (max-width: 992px) {
            .card-container {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            }
        }

        @media (max-width: 768px) {
            nav {
                width: 70px;
            }

            nav a span,
            nav .dropdown-toggle span,
            nav .dropdown-toggle .fa-angle-down {
                display: none;
            }

            nav a,
            nav .dropdown-toggle {
                justify-content: center;
                padding: 13px 0;
            }

            nav .dropdown-item {
                padding-left: 0;
                justify-content: center;
            }

            header {
                padding: 14px 20px;
            }

            header h1 span {
                display: none;
            }

            section {
                padding: 20px 15px;
            }

            .user-bar .user-name {
                display: none;
            }

            .card-container {
                grid-template-columns: 1fr;
            }
        }

        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes dropdownFadeIn {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }
    </style>
</head>
<body>

<header>
    <h1>
        <i class="fa fa-book"></i>
        <span>我的笔记系统 - 工作台</span>
    </h1>
    <div class="user-bar">
        <div class="user-info">
            <div class="user-avatar">A</div>
            <span class="user-name">admin</span>
        </div>
        <button class="logout-btn" onclick="logout()">
            <i class="fa fa-sign-out"></i>
            登出
        </button>
    </div>
</header>

<main>
    <nav>
        <a href="login.html">
            <i class="fa fa-lock"></i>
            <span>登录</span>
        </a>
        <a href="register.html">
            <i class="fa fa-pencil"></i>
            <span>注册</span>
        </a>
        <!-- 我的文章下拉菜单（核心优化部分） -->
        <div class="dropdown">
            <a href="#" class="dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                <i class="fa fa-folder-open"></i>
                <span>我的文章</span>
                <i class="fa fa-angle-down"></i>
            </a>
            <ul class="dropdown-menu">
                <li>
                    <a class="dropdown-item" href="post.html">
                        <i class="fa fa-upload"></i>
                        文件上传
                    </a>
                </li>
                <li>
                    <a class="dropdown-item" href="article-create.html">
                        <i class="fa fa-pencil"></i>
                        发布新文章
                    </a>
                </li>
                <li>
                    <a class="dropdown-item" href="articles">
                        <i class="fa fa-list-ul"></i>
                        查看文章列表
                    </a>
                </li>
            </ul>
        </div>
        <a href="introduction.html">
            <i class="fa fa-user"></i>
            <span>个人简介</span>
        </a>
        <a href="dashboard.html" class="active">
            <i class="fa fa-tachometer"></i>
            <span>工作台</span>
        </a>
        <a href="#">
            <i class="fa fa-cog"></i>
            <span>设置（预留）</span>
        </a>
    </nav>

    <section id="content">
        <div class="welcome-section">
            <h2>欢迎回来，admin！</h2>
            <p>这是您的个人笔记系统工作台，可快速访问核心功能，管理您的笔记和个人信息。</p>
        </div>

        <div class="card-container">
            <!-- 文章功能入口卡片 - 占满整行 -->
            <div class="card article-card full-width-card">
                <h3>
                    <i class="fa fa-newspaper-o"></i>
                    文章功能
                </h3>
                <p>查看文章列表，浏览推荐文章，或发布新文章。</p>
                <div class="action-buttons">
                    <a href="articles" class="action-btn primary"><i class="fa fa-list-ul"></i> 查看文章列表</a>
                    <a href="article-create.html" class="action-btn success"><i class="fa fa-pencil"></i> 发布新文章</a>
                </div>
            </div>

            <!-- 最近笔记卡片 -->
            <div class="card recent-note-card">
                <h3>
                    <i class="fa fa-file-text-o"></i>
                    最近笔记
                </h3>
                <p>您上次创建的笔记标题是：<a href="post.html" class="with-icon">学习Spring Boot启动流程 <i class="fa fa-angle-right"></i></a></p>
                <div class="note-info">
                    <span class="note-date"><i class="fa fa-calendar-o"></i> 2024-05-20</span>
                    <a href="post.html" class="note-action">查看全部 <i class="fa fa-arrow-right"></i></a>
                </div>
            </div>

            <!-- 小提示卡片 -->
            <div class="card tip-card">
                <h3>
                    <i class="fa fa-lightbulb-o"></i>
                    小提示
                </h3>
                <p>点击左侧导航栏可快速跳转至对应功能模块，常用操作将自动记忆，无需重复操作。</p>
            </div>

            <!-- 后续功能卡片 -->
            <div class="card future-card">
                <h3>
                    <i class="fa fa-rocket"></i>
                    后续功能
                </h3>
                <p>未来将支持：
                    <span class="tag">笔记分类</span>
                    <span class="tag">标签管理</span>
                    <span class="tag">数据统计</span>
                    <span class="tag">回收站</span>
                    <span class="tag">云同步</span>
                    等功能，敬请期待！
                </p>
            </div>
        </div>
    </section>
</main>

<script>
    function logout() {
        if (confirm("确定要退出登录吗？")) {
            alert("您已成功退出登录，即将返回登录页");
            window.location.href = "login.html";
        }
    }
</script>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

</body>
</html>